home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
forms
/
demotod
/
demotod.frm
< prev
next >
Wrap
Text File
|
1995-06-09
|
6KB
|
230 lines
VERSION 2.00
Begin Form DemoTOD
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Tip of the Day"
ClientHeight = 2940
ClientLeft = 1905
ClientTop = 2505
ClientWidth = 5625
ControlBox = 0 'False
Height = 3345
Left = 1845
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2940
ScaleWidth = 5625
Top = 2160
Width = 5745
Begin SSFrame Frame3D1
Font3D = 0 'None
Height = 2445
Left = 105
TabIndex = 4
Top = 30
Width = 4125
Begin TextBox Text_TOD
BorderStyle = 0 'None
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 1365
Left = 240
MultiLine = -1 'True
TabIndex = 5
Text = "Tip of the Day Tip...."
Top = 960
Width = 3615
End
Begin Line Line2
Index = 1
X1 = 3990
X2 = 3990
Y1 = 210
Y2 = 2340
End
Begin Line Line2
Index = 0
X1 = 100
X2 = 100
Y1 = 210
Y2 = 2340
End
Begin Line Line1
Index = 1
X1 = 110
X2 = 4010
Y1 = 2330
Y2 = 2330
End
Begin Line Line1
Index = 0
X1 = 110
X2 = 4010
Y1 = 190
Y2 = 190
End
Begin Shape Shape2
BackColor = &H00FFFFFF&
BackStyle = 1 'Opaque
BorderColor = &H00FFFFFF&
Height = 1365
Left = 120
Top = 960
Width = 3885
End
Begin Label Label1
Caption = "Did you know..."
Height = 225
Left = 720
TabIndex = 6
Top = 570
Width = 1395
End
Begin Image Image1
Height = 570
Left = 210
Picture = DEMOTOD.FRX:0000
Top = 300
Width = 420
End
Begin Shape Shape1
BackStyle = 1 'Opaque
BorderColor = &H00FFFFFF&
Height = 765
Left = 120
Top = 210
Width = 3885
End
End
Begin SSCheck Check3D_TOD
Caption = "Show Tips at Startup"
Font3D = 0 'None
Height = 255
Left = 105
TabIndex = 3
Top = 2580
Value = -1 'True
Width = 2085
End
Begin CommandButton Command_TOD
Caption = "&Help"
Height = 315
Index = 2
Left = 4350
TabIndex = 2
Top = 990
Width = 1170
End
Begin CommandButton Command_TOD
Caption = "&Next"
Height = 315
Index = 1
Left = 4350
TabIndex = 1
Top = 540
Width = 1170
End
Begin CommandButton Command_TOD
Caption = "OK"
Height = 315
Index = 0
Left = 4365
TabIndex = 0
Top = 105
Width = 1170
End
End
Option Explicit
Dim FileNum
Dim TipPos&
Dim TipLen%
Dim Tip$
Sub Command_TOD_Click (Index As Integer)
Select Case Index
Case 0
DemoApp.VBini.Section = "TOD"
DemoApp.VBini.Entry = "TipPos"
DemoApp.VBini.String = Str(TipPos&)
DemoApp.VBini.Refresh
DemoApp.VBini.Entry = "TipStart"
DemoApp.VBini.String = IIf(Check3D_TOD = True, " ", "No")
DemoApp.VBini.Refresh
Unload Me
Set DemoTOD = Nothing
Case 1
GetNextTip
Case 2
' dummy% = WinHelp(Me.hWnd, App.HelpFile, HELP_CONTEXT, HlpCntxtID&)
End Select
End Sub
Sub Form_Activate ()
If Me.Width = 1 Then
Unload Me
Set DemoTOD = Nothing
End If
End Sub
Sub Form_Load ()
' HlpCntxtID& = Tip_of_the_Day
Me.Move (Screen.Width - Me.Width) / 2, ((Screen.Height - Me.Height) / 2) + 200
DemoApp.VBini.FileName = App.Path + "\DemoApp.INI"
DemoApp.VBini.Section = "TOD"
DemoApp.VBini.Entry = "TipPos"
DemoApp.VBini.String = ""
DemoApp.VBini.Refresh
TipPos& = IIf(DemoApp.VBini.String = "", 1, Val(DemoApp.VBini.String))
On Error GoTo SeeYa
FileNum = FreeFile
Open App.Path & "\TOD.TIP" For Binary As FileNum
GetNextTip
Exit Sub
SeeYa:
Me.Width = 1
Me.Height = 1
End Sub
Sub GetNextTip ()
If TipPos& >= LOF(FileNum) Then
TipPos& = 1
End If
Get FileNum, TipPos&, TipLen%
Text_TOD = Input$(TipLen%, FileNum)
TipPos& = Seek(FileNum)
If TipPos& >= LOF(FileNum) Then
TipPos& = 1
End If
End Sub